﻿using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Console;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace UtilsBase.log
{

    public class UtilsLogger
    {
        public readonly ILogger logger;
        public UtilsLogger()
        {

            ILoggerFactory loggerFactory = LoggerFactory.Create(builder => builder
       .AddFilter("Microsoft", LogLevel.Debug)
       .AddFilter("System", LogLevel.Debug)
       .AddFilter("Namespace.Class", LogLevel.Debug)
       .AddConsole()
   );
            logger = loggerFactory.CreateLogger("Namespace.Class");
        }
        public void testLogInfo()
        {
            logger.LogError("This is an error message.");
            logger.LogInformation("This is an information message.");
            logger.LogDebug("This is a debug message.");

        }
    }
}
